﻿/*
#------------------------------------------------------------------------------
#-- Program Name:	[dbo].[spMSX_get_servers_needing_reinventory]
#-- Purpose:		Get a list of servers that have been previously discovered
#--					or manually added, but have not been inventoried within
#--					the last 24 hours.
#--	Last Update:	04/19/2013
#--					For a complete history - please review comments in Version
#--					Control.
#------------------------------------------------------------------------------
*/
CREATE PROCEDURE [dbo].[spMSX_get_servers_needing_reinventory]
AS

SET NOCOUNT ON

SELECT	ssd_sqlserver_name_ro,
		ssd_last_update,
		ssd_last_error
FROM	[dbo].[tblMSX_server_discovery]
WHERE	ssd_is_disabled = 0 
		AND ISNULL(ssd_last_update, '1/1/1900') < DATEADD(dd, -1, GETDATE())
		AND ISNULL(ssd_last_error, '1/1/1900') < DATEADD(dd, -1, GETDATE())

SET NOCOUNT OFF